package MercuryTour;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

public class loginPage {
	
	@FindBy(name = "userName")
	WebElement userName;
	
	@FindBy(name = "password")
	WebElement password;
	
	@FindBy(name = "login")
	WebElement loginButton;
	
	@FindBy(xpath = "/html/body/div/table/tbody/tr/td[2]/table/tbody/tr[4]/td/table/tbody/tr/td[2]/table/tbody/tr[2]/td[3]/form/table/tbody/tr[10]/td/table/tbody/tr/td[2]/font/a")
	WebElement registrationButton;
	
	// Click Register link for registration process
	
	public registrationPage registerAsMember ()
	{
		registrationButton.click();
		return new registrationPage();
	}
	
	public void loginTo(String[] credentials)
	{
		userName.sendKeys(credentials[0]);
		password.sendKeys(credentials[1]);
		loginButton.click();
	}

}
